#include<stdio.h>
/* int main()
{
    int a,b;
    int sum,difference,product;
    double q,ave;
    scanf("%d %d",&a,&b);
    sum=a+b;
    difference=a-b;
    product=a*b;
    q=(double)a/b;
    ave=(double)(a+b)/2;
    printf("差：%d\n",difference);
    printf("和：%d\n",sum);
    printf("鸡：%d\n",product);
    printf("%.2f\n",q);
    printf("平均值：%.2f\n",ave);
    return 0;
 */
/* nt main()
{
    int dogs;
    do
    {printf("How many dogs do you have?\n");
    scanf("%d",&dogs);
    printf("So,you have %d dog(s).",dogs);
    printf("\n");
    }while(1);
    return 0;

} */
#include <stdio.h>
int judge(int x)
{
    if(x%2==0)
    return x/2;
    else 
    return x*3+1;  
}
int main() {
    int n=0;
    scanf("%d",&n);
    int sum=0;
    int count=-1;
    //判断奇数偶数
    do{
       sum = sum + judge(n);
       count++;
    }while(sum!=1);
    return 0;
}